package com.runa.monitor.platinterface.extend.third.controller;


import com.alibaba.fastjson.JSON;
import com.runa.monitor.platinterface.extend.third.newester.pojo.NetEquDockingDataVo;
import com.runa.monitor.platinterface.extend.third.pojo.Result;
import com.runa.monitor.platinterface.extend.third.service.IThirdPartOfMeterService;
import com.runa.monitor.platinterface.extend.third.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("comm")
public class ThirdPartOfMeterController {
    @Resource
    private IThirdPartOfMeterService thirdPartOfMeterService;

//    @ApiOperation("批量保存户表数据")
    @PostMapping("batchSaveHouseMeterData")
    public Result<List<DockingDataResponseVo>> batchSaveHouseMeterData(@RequestBody List<HouseMeterDockingDataVo> houseMeterDockingDataVos) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(houseMeterDockingDataVos));
        return thirdPartOfMeterService.batchSaveHouseMeterData(houseMeterDockingDataVos);
    }

//    @ApiOperation("批量保存户阀数据")
    @PostMapping("batchSaveHouseValveData")
    public Result<List<DockingDataResponseVo>> batchSaveHouseValveData(@RequestBody List<HouseValveDockingDataVo> houseValveDockingDataVos) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(houseValveDockingDataVos));
        return thirdPartOfMeterService.batchSaveHouseValveData(houseValveDockingDataVos);
    }

//    @ApiOperation("批量保存温度面板数据")
    @PostMapping("batchSaveTemperaturePanelData")
    public Result<List<DockingDataResponseVo>> batchSaveTemperaturePanelData(@RequestBody List<TemperaturePanelDockingDataVo> temperaturePanelDockingDataVos) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(temperaturePanelDockingDataVos));
        return thirdPartOfMeterService.batchSaveTemperaturePanelData(temperaturePanelDockingDataVos);
    }

//    @ApiOperation("批量保存温压监测仪数据")
    @PostMapping("batchSaveTemperaturePressureData")
    public Result<List<DockingDataResponseVo>> batchSaveTemperaturePressureData(@RequestBody List<TemperaturePressureDataDockingDataVo> temperaturePressureDataDockingDataVos) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(temperaturePressureDataDockingDataVos));
        return thirdPartOfMeterService.batchSaveTemperaturePressureData(temperaturePressureDataDockingDataVos);
    }

//    @ApiOperation("批量保存网络设备数据")
    @PostMapping("batchSaveNetEquData")
    public Result<List<DockingDataResponseVo>> batchSaveNetEquData(@RequestBody List<NetEquDockingDataVo> netEquDockingDataVos) {
        return thirdPartOfMeterService.batchSaveNetEquData(netEquDockingDataVos);
    }

//    @ApiOperation("批量保存换热站数据")
    @PostMapping("batchSaveStationMeterData")
    public Result<List<DockingDataResponseVo>> batchSaveStationMeterData(@RequestBody List<StationMeterDataDockingDataVo> stationMeterDataDockingDataVos) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(stationMeterDataDockingDataVos));
        return thirdPartOfMeterService.batchSaveStationMeterData(stationMeterDataDockingDataVos);
    }


//    @ApiOperation("保存东营楼阀实时和历史数据")
    @PostMapping("saveDongYingBuildValveData")
    public Result<Integer> saveDongYingBuildValveData(@RequestBody List<DoYBuildValveParamVo> doYBuildValveParamVoList) {
        log.info("第三方数据---batchSaveHouseMeterData:"+ JSON.toJSONString(doYBuildValveParamVoList));
        return thirdPartOfMeterService.saveDongYingBuildValveData(doYBuildValveParamVoList);
    }
}
